<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Application template - Include content page
 */
if (!function_exists('pagination')) {

    function pagination($limit, $segment, $base_url, $total_rows, $num_links) {
        $CI = & get_instance();

        $config['uri_segment'] = $segment;
        $config['base_url'] = $base_url;
        $config['total_rows'] = $total_rows;
        $config['per_page'] = $limit;
        $config['num_links'] = $num_links;
        //Style pagination
        $config['full_tag_open'] = '<ul class="pagination">';
        $config['full_tag_close'] = '</ul>';
        $config['prev_link'] = '&lt; Prev';
        $config['prev_tag_open'] = '<li class="paginate_button previous">';
        $config['prev_tag_close'] = '</li>';
        $config['next_link'] = 'Next &gt;';
        $config['next_tag_open'] = '<li class="paginate_button next" >';
        $config['next_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li class="paginate_button active"><a href="#">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li  class="paginate_button" >';
        $config['num_tag_close'] = '</li>';
        $config['first_link'] = FALSE;
        $config['last_link'] = FALSE;
        return $CI->pagination->initialize($config);
    }

}

// ------------------------------------------------------------------------

